/**
 * 请将下面代码，变量声明换用let 或const , 函数使用箭头函数
 */

const demo1 =  () => {
	const students = [
		{ number: 1001, name: 'jack', score: 98, gender: '男' },
		{ number: 1002, name: 'rose', score: 95, gender: '女' },
		{ number: 1003, name: '小丽', score: 85, gender: '女' },
	]
	//总分
    const total = students.reduce((previous,current)=> previous + current.score,0)

    console.log('总分 ',total);
    //平均分
    let avg = total/students.length
    avg = avg.toFixed(2)
    console.log('平均分 ',avg);

    //大于平均分学生
    const newArr = students.filter((item)=>item.score > avg)

    console.log('大于平均分学生 ',newArr)
}
demo1()